package com.ellwood.copyright.common.core.result;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * @ProjectName: ell-copyright-pro
 * @PackageName: com.ellwood.copyright.common.core.result.pojo
 * @ClassName: EllPageResult
 * @Description: // TODO
 * @Author: Ellwood
 * @CreateDate: 2024/11/11 - 23:29
 * @Version: V1.0.0
 */
@Data
@Schema(description = "分页返回结果")
public class EllPageResult<T> implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "总记录数")
    private int total;

    @Schema(description = "列表数据")
    private List<T> list;

    /**
     * 分页
     *
     * @param list  列表数据
     * @param total 总记录数
     */
    public EllPageResult(List<T> list, long total) {
        this.list = list;
        this.total = (int) total;
    }

}
